package com.authine.cloudpivot.ext.dto.model.invoice;

import com.authine.mvp.app.launcher.domain.AttachmentFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Date;
import java.util.List;

@Data
@SuperBuilder
@NoArgsConstructor
@Accessors(chain = true)
@Schema(description = "红冲Model")
public class OffsetInvoice {

    private static final long serialVersionUID = -6363842887181893297L;

    /**
     * 发票申请单ID
     */
    @Schema(description = "发票申请单号", required = true)
    private String id;

//    /**
//     * 创建空发票（没有明细）核销时用到的红冲金额
//     */
//    @Schema(description = "红冲没有明细的发票单的红冲金额(含税)")
//    private BigDecimal total;

    /**
     * 红冲金额(未税)
     */
    @Schema(description = "红冲金额(未税)")
    private BigDecimal price_amount;

    /**
     * 红冲税额
     */
    @Schema(description = "红冲税额")
    private BigDecimal tax_amount;

    /**
     * 开票时间
     */
    @Schema(description = "开票时间", required = true)
    private Date invoice_time;

    /**
     * 抵消发票明细，如果明细为空，整张发票红冲
     */
    @Schema(description = "部分红冲发票明细")
    private Collection<OffsetInvoiceDetail> offsetInvoiceDetails;

    /**
     * 发票记录表
     */
    @Schema(description = "开票记录", required = true)
    private List<InvoiceRecord> invoiceApplyRecordList;

    /**
     * 票面开票人
     */
    @Schema(description = "开票人", required = true)
    private String drawer;

    /**
     * 发票附件地址
     */
    @Schema(description = "发票附件地址")
    private List<AttachmentFormat> attachments_json;

}
